<div class="row">
	<div class="col-md-12">
		<!-- Custom Tabs -->
		<div class="nav-tabs-custom">
			<ul class="nav nav-tabs">
				<li>
					<a href="<?php echo base_url();?>employers/welcome" > Welcome</a>
				</li>
				<li>
					<a href="<?php echo base_url(); ?>employers/job-ads"> New Job Ads</a>
				</li>
				<li  class="active">
					<a href="<?php echo base_url(); ?>employers/current-job-ads">My Current Job Ads</a>
				</li>
				<li>
					<a href="<?php echo base_url(); ?>employers/expired-job-ads">Expired Job Ads</a>
				</li>
				<li>
					<a href="<?php echo base_url(); ?>employers/banners">Banners</a>
				</li>
				<li class="dropdown pull-right">
					<a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="glyphicon glyphicon-user"/></i> <?php echo $username; ?> <span class="caret"></span> </a>
					<ul class="dropdown-menu">
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/change-picture">Change Picture</a>
						</li>
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/change-password">Change Password</a>
						</li>
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/profile">Profile</a>
						</li>
						<li role="presentation" class="divider"></li>
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/logout">Logout</a>
						</li>
					</ul>
				</li>
				
			</ul>
			<div class="tab-content">
				<div class="tab-pane active" id="tab_1">
					
<form role="form" class="remove-box-border" method="post" action="<?php echo base_url(); ?>employers/modify-job-ads/<?php echo $this -> uri -> segment(3); ?>">
<div class="box box-primary">
					<div class="box-header">
						<h3 class="box-title"><span style="color:#3C8DBC !important;">	Modify the selected job ads</span></h3>
					</div><!-- /.box-header -->
					<!-- form start -->

					<div class="box-body">
						<div class="form-group">
							<label for="category">Category <span class="required">*</span></label>
							<select name="category" class="form-control">
								<?php echo $categories; ?>
							</select>
							<?php echo form_error('category'); ?>
						</div>
						<div class="form-group">
							<label for="location">Location <span class="required">*</span></label>
							<select name="location" class="form-control">
								<?php
									foreach($locations->result() as $location){
										$location_id=$location->job_location_id;
										$name=$location->name;
										
								?>
										<option value="<?php echo $location_id; ?>" <?php echo ($job_ads_info->row()->using_job_location_id==$location_id)? 'selected':'';?>><?php echo $name; ?></option>
								<?php
								}
								?>
							</select>
							<?php echo form_error('location'); ?>
						</div>
						<div class="form-group">
							<label for="job_type">Job Type </label>
							<select name="job_type" class="form-control">
								<?php
									foreach($job_types->result() as $job_type){
										$job_type_id=$job_type->job_type_id;
										$name=$job_type->name;
								?>
										<option value="<?php echo $job_type_id; ?>" <?php echo ($job_ads_info->row()->using_job_type_id==$job_type_id)? 'selected':'';?>><?php echo $name; ?></option>
								<?php
								}
								?>
							</select>
							
						</div>
						<div class="form-group">
							<label for="job_terms">Job Terms <span class="required">*</span></label>
							<select name="job_terms" class="form-control">
								<?php
									foreach($job_terms->result() as $job_term){
										$job_term_id=$job_term->job_term_id;
										$name=$job_term->name;
								?>
										<option value="<?php echo $job_term_id; ?>" <?php echo ($job_ads_info->row()->using_job_term_id==$job_term_id)? 'selected':'';?>><?php echo $name; ?></option>
								<?php
								}
								?>
							</select>
							<?php echo form_error('job_terms'); ?>
						</div>
						<div class="form-group">
							<label for="edu_level">Education Level </label>
							<select name="edu_level" class="form-control">
								<?php
									foreach($edu_levels->result() as $edu_level){
										$edu_level_id=$edu_level->education_level_id;
										$name=$edu_level->name;
								?>
										<option value="<?php echo $edu_level_id; ?>" <?php echo ($job_ads_info->row()->using_education_level_id==$edu_level_id)? 'selected':'';?>><?php echo $name; ?></option>
								<?php
								}
								?>
							</select>
							
						</div>
						<div class="form-group">
							<label for="title">Job Title <span class="required">*</span></label>
							<input type="text" class="form-control" id="title" name="title" placeholder="Job Title" value="<?php echo $job_ads_info -> row() -> title; ?>" required="required">
							<?php echo form_error('title'); ?>
						</div>
						<div class="form-group">
							<label for="age">Age </label>
							<input type="text" class="form-control" id="age" name="age" placeholder="Age" value="<?php echo $job_ads_info -> row() -> age; ?>">
							<?php echo form_error('age'); ?>
						</div>
						<div class="form-group">
							<label for="salary">Salary ($)</label>
							<input type="text" class="form-control" id="salary" name="salary" placeholder="Salary" value="<?php echo $job_ads_info -> row() -> salary; ?>">
							<?php echo form_error('salary'); ?>
						</div>
						<div class="form-group">
							<label for="num_hiring">Hiring </label>
							<input type="text" class="form-control" id="num_hiring" name="num_hiring" placeholder="Number of hiring" value="<?php echo $job_ads_info -> row() -> hiring; ?>">
							<?php echo form_error('num_hiring'); ?>
						</div>
						
						
						<div class="form-group">
							<label for="gender">Gender </label>
							<select name="gender" class="form-control">
								<option value="Unlimited" <?php echo ($job_ads_info->row()->gender=="Unlimited")? 'selected':'';?>>Unlimited</option>
								<option value="Male" <?php echo ($job_ads_info->row()->gender=="Male")? 'selected':'';?>>Male</option>
								<option value="Female" <?php echo ($job_ads_info->row()->gender=="Female")? 'selected':'';?>>Female</option>
							</select>
							<?php echo form_error('gender'); ?>
						</div>
						<div class="form-group">
							<label for="date_available">Date Available (dd/mm/yyyy)<span class="required">*</span></label>
							<?php

							$date_available_db = explode("-", $job_ads_info -> row() -> date_available);
							$date_available = $date_available_db[2] . "/" . $date_available_db[1] . "/" . $date_available_db[0];
							?>
							<input type="text" class="form-control" id="date_available" name="date_available" data-inputmask="'alias': 'dd/mm/yyyy'" data-mask  required="required" value="<?php echo $date_available; ?>">
							<?php echo form_error('date_available'); ?>
						</div>
						<div class="form-group">
							<label for="description">Job Description</label>
							<textarea class="textarea" name="description" placeholder="Place some text description here" style="width: 100%; height: 215px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"><?php echo $job_ads_info -> row() -> text_description; ?></textarea>
							<?php //echo form_error('company_desc'); ?>
						</div>
						<div class="form-group">
							<label for="requirement">Job Requirement</label>
							<textarea class="textarea" name="requirement" placeholder="Place some text requirement here" style="width: 100%; height: 215px; font-size: 14px; line-height: 18px; border: 1px solid #dddddd; padding: 10px;"><?php echo $job_ads_info -> row() -> text_requirements; ?></textarea>
							<?php //echo form_error('company_desc'); ?>
						</div>
						
						
						<div class="form-group">
							<label for="contact_person">Contact Person <span class="required">*</span> &nbsp;&nbsp;<a href="<?php echo base_url();?>employers/create-contact-person" alt="New Contact person" target="_blank" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-plus"></span> New</a></label>
							<select name="contact_person" class="form-control">
								<?php
									foreach($contact_persons->result() as $contact_person){
										$contact_person_id=$contact_person->contact_person_id;
										$name=$contact_person->name;
								?>
										<option value="<?php echo $contact_person_id; ?>" <?php echo ($job_ads_info->row()->using_contact_person_id==$contact_person_id)? 'selected':'';?>><?php echo $name; ?></option>
								<?php
								}
								?>
							</select>
							<?php echo form_error('contact_person'); ?>
						</div>
						<div class="form-group">
							<label for="active">Active </label>
							<select name="active" class="form-control">
								<option value="1" <?php echo ($job_ads_info->row()->status==1)? 'selected':'';?>>YES</option>
								<option value="0" <?php echo ($job_ads_info->row()->status==0)? 'selected':'';?>>NO</option>
							</select>
							<?php echo form_error('active'); ?>
						</div>
						<div class="form-group">
							<label for="notification">Notification </label>
							<select name="notification" class="form-control">
								<option value="1" <?php echo ($job_ads_info->row()->notification==1)? 'selected':'';?>>YES</option>
								<option value="0" <?php echo ($job_ads_info->row()->notification==0)? 'selected':'';?>>NO</option>
							</select>
							<?php echo form_error('notification'); ?>
						</div>
						

					</div><!-- /.box-body -->

					<div class="box-footer">
						<button type="submit" class="btn btn-success">
							<span class="glyphicon glyphicon-saved"></span> Submit
						</button>
						<button type="button" onclick="goBack();" class="btn btn-warning">
							<span class="glyphicon glyphicon-remove-circle"></span> Cancel
						</button>
					</div>

				</div><!-- /.box -->
</form>
				</div><!-- /.tab-pane -->
			</div><!-- /.tab-content -->
		</div><!-- nav-tabs-custom -->
	</div><!-- /.col -->
</div>

